local _, GrifonOvaleScripts = ...

GrifonOvaleScripts.script.DRUID.Attilio = {
	desc = "[5.4] Attilio Beta Balance",
	code =
[[


Define(aquatic_form 1066)
	SpellInfo(aquatic_form duration=86400 rage=-10)
	SpellAddBuff(aquatic_form aquatic_form=1)
Define(astral_communion 127663)
	SpellInfo(astral_communion canStopChannelling=4 duration=4 haste=spell tick=1)
	SpellAddBuff(astral_communion astral_communion=1)
Define(astral_storm 106996)
	SpellInfo(astral_storm canStopChannelling=10 duration=10 haste=spell tick=1)
Define(barkskin 22812)
	SpellInfo(barkskin cd=60 duration=12)
	SpellInfo(barkskin addcd=-15 mastery=4)
	SpellAddBuff(barkskin barkskin=1)
Define(bear_form 5487)
	SpellInfo(bear_form duration=86400 rage=-10)
	SpellAddBuff(bear_form bear_form=1)
Define(bear_hug 102795)
	SpellInfo(bear_hug cd=60 duration=3)
	SpellAddDebuff(bear_hug bear_hug=1)
Define(berserk 106952)
Define(berserk_bear 50334)
	SpellInfo(berserk_bear cd=180 duration=10)
	SpellAddBuff(berserk_bear berserk_bear=1)
Define(berserk_cat 106951)
	SpellInfo(berserk_cat cd=180 duration=15)
	SpellAddBuff(berserk_cat berserk_cat=1)
Define(cat_form 768)
	SpellInfo(cat_form duration=86400)
	SpellAddBuff(cat_form cat_form=1)
Define(celestial_alignment 112071)
	SpellInfo(celestial_alignment cd=180 duration=15)
	SpellAddBuff(celestial_alignment celestial_alignment=1)
Define(cenarion_ward 102351)
	SpellInfo(cenarion_ward cd=30 duration=30)
Define(cenarion_ward_hot 102352)
	SpellInfo(cenarion_ward_hot duration=6 haste=spell tick=2)
Define(cenarion_ward_talent 6)
Define(chosen_of_elune 102560)
	SpellInfo(chosen_of_elune cd=180 duration=30)
Define(clearcasting 16870)
Define(cyclone 33786)
	SpellAddBuff(cyclone natures_swiftness=0)
Define(dash 1850)
	SpellInfo(dash cd=180 duration=15)
	SpellInfo(dash addcd=-60 glyph=glyph_of_dash)
Define(disorienting_roar 99)
	SpellInfo(disorienting_roar cd=30)
Define(disorienting_roar_talent 10)
Define(displacer_beast 102280)
	SpellInfo(displacer_beast cd=30)
	SpellAddBuff(displacer_beast cat_form=1 displacer_beast_buff=1)
Define(displacer_beast_buff 137452)
	SpellInfo(displacer_beast_buff duration=4)
Define(displacer_beast_talent 2)
Define(dream_of_cenarius_damage 108381)
	SpellInfo(dream_of_cenarius_damage duration=30)
Define(dream_of_cenarius_heal 108382)
	SpellInfo(dream_of_cenarius_heal duration=30)
Define(dream_of_cenarius_tank 145162)
	SpellInfo(dream_of_cenarius_tank duration=20)
Define(dream_of_cenarius_talent 17)
Define(enrage 5229)
	SpellInfo(enrage cd=60 duration=10 rage=-20)
	SpellAddBuff(enrage enrage=1)
Define(entangling_roots 339)
	SpellAddBuff(entangling_roots natures_swiftness=0 predatory_swiftness=0)
Define(euphoria 81062)
Define(fae_silence 114238)
	SpellInfo(fae_silence duration=3)
Define(faerie_fire 770)
	SpellInfo(faerie_fire duration=300)
	SpellInfo(faerie_fire cd=6 if_stance=druid_bear_form)
	SpellInfo(faerie_fire cd=6 if_stance=druid_cat_form)
	SpellInfo(faerie_fire cd=15 glyph=glyph_of_fae_silence)
	SpellAddTargetDebuff(faerie_fire faerie_fire=1 weakened_armor=1)
Define(faerie_swarm 102355)
	SpellInfo(faerie_swarm duration=300)
	SpellInfo(faerie_swarm cd=6 if_stance=druid_bear_form)
	SpellInfo(faerie_swarm cd=6 if_stance=druid_cat_form)
	SpellInfo(faerie_swarm cd=15 glyph=glyph_of_fae_silence)
	SpellAddTargetDebuff(faerie_swarm faerie_swarm=1 weakened_armor=1)
Define(faerie_swarm_talent 7)
Define(feline_swiftness_talent 1)
Define(ferocious_bite 22568)
	SpellInfo(ferocious_bite combo=0)
	# Ferocious Bite does ((316 to 658) + 762 * CP + 0.196 * AP * CP) damage (from Wowhead).
	# Average the base damage to (316 + 658) / 2 = 487.
	SpellInfo(ferocious_bite base=487 bonuscp=762 bonusapcp=0.196)
	SpellDamageBuff(ferocious_bite dream_of_cenarius_damage=1.3)
Define(force_of_nature_talent 12)
Define(frenzied_regeneration 22842)
	SpellInfo(frenzied_regeneration cd=1.5)
Define(frenzied_regeneration_glyphed 124769)
	SpellInfo(frenzied_regeneration_glyphed duration=6 rage=50)
	SpellAddBuff(frenzied_regeneration_glyphed frenzied_regeneration_glyphed=1)
Define(genesis 145518)
Define(glyph_of_blooming 121840)
Define(glyph_of_dash 59219)
Define(glyph_of_fae_silence 114237)
Define(glyph_of_frenzied_regeneration 54810)
Define(glyph_of_might_of_ursoc 116238)
Define(glyph_of_natures_grasp 116203)
Define(glyph_of_savagery 127540)
Define(glyph_of_shred 114234)
Define(glyph_of_skull_bash 116216)
Define(glyph_of_survival_instincts 114223)
Define(glyph_of_wild_growth 62970)
Define(growl 6795)
	SpellInfo(growl cd=8)
	SpellAddBuff(growl bear_form=1)
Define(healing_touch 5185)
	SpellAddBuff(healing_touch natures_swiftness=0 predatory_swiftness=0)
Define(heart_of_the_wild 108292)
	SpellInfo(heart_of_the_wild cd=360)
	SpellAddBuff(heart_of_the_wild heart_of_the_wild=1)
Define(heart_of_the_wild_talent 16)
Define(hibernate 2637)
	SpellAddBuff(hibernate natures_swiftness=0 predatory_swiftness=0)
Define(hurricane 16914)
	SpellInfo(hurricane canStopChannelling=10 duration=10 haste=spell tick=1)
Define(incarnation 106731)
	SpellInfo(incarnation cd=180)
Define(incarnation_talent 11)
Define(infected_wounds 58180)
    SpellInfo(infected_wounds duration=12)
Define(innervate 29166)
	SpellInfo(innervate cd=180 duration=10 tick=1)
Define(ironbark 102342)
	SpellInfo(ironbark cd=90 duration=12)
	SpellAddTargetBuff(ironbark ironbark=1)
Define(king_of_the_jungle 102543)
	SpellInfo(king_of_the_jungle cd=180 duration=30)
Define(lacerate 33745)
	SpellInfo(lacerate cd=3 duration=15 tick=3)
	SpellAddTargetDebuff(lacerate lacerate=1)
Define(lifebloom 33763)
	SpellInfo(lifebloom duration=15 haste=spell tick=1)
	SpellInfo(lifebloom addduration=-5 glyph=glyph_of_blooming)
Define(living_seed 48504)
	SpellInfo(living_seed duration=15)
Define(lunar_eclipse 48518)
Define(lunar_shower 81192)
	SpellInfo(lunar_shower duration=3)
Define(maim 22570)
	SpellInfo(maim cd=10 combo=0)
Define(mangle 33917)
Define(mangle_bear 33878)
	SpellInfo(mangle_bear buffnocd=mangle_buffnocd cd=6 rage=-5)
	SpellInfo(mangle_bear rage=-8 talent=soul_of_the_forest_talent)
	SpellAddTargetDebuff(mangle_bear infected_wounds=1)
SpellList(mangle_buffnocd berserk_bear son_of_ursoc)
Define(mangle_cat 33876)
	SpellInfo(mangle_cat combo=1 inccounter=ripshreds)
	SpellInfo(mangle_cat critcombo=1 if_spell=primal_fury)
	SpellAddTargetDebuff(mangle_cat infected_wounds=1)
Define(mark_of_the_wild 1126)
	SpellInfo(mark_of_the_wild duration=3600)
	SpellAddBuff(mark_of_the_wild mark_of_the_wild=1)
Define(mass_entanglement cd=30 duration=20)
Define(mass_entanglement_talent 8)
Define(maul 6807)
	SpellInfo(maul cd=3 rage=30)
	SpellAddTargetDebuff(maul infected_wounds=1)
Define(might_of_ursoc 106922)
	SpellInfo(might_of_ursoc cd=180 duration=20)
	SpellInfo(might_of_ursoc addcd=120 glyph=glyph_of_might_of_ursoc)
	SpellInfo(might_of_ursoc addcd=-60 itemset=T14_tank itemcount=2)
	SpellAddBuff(might_of_ursoc bear_form=1 might_of_ursoc=1)
Define(mighty_bash 5211)
	SpellInfo(mighty_bash cd=50 duration=5)
	SpellAddTargetDebuff(mighty_bash mighty_bash=1)
Define(mighty_bash_talent 15)
Define(moonfire 8921)
	SpellInfo(moonfire duration=14 haste=spell tick=2)
	SpellInfo(moonfire addduration=2 itemset=T14_caster itemcount=4)
	SpellAddTargetDebuff(moonfire lunar_shower=1 moonfire=1)
Define(moonkin_form 24858)
	SpellInfo(moonkin_form duration=86400)
	SpellAddBuff(moonkin_form moonkin_form=1)
Define(natures_cure 88423)
	SpellInfo(natures_cure cd=8)
Define(natures_grace 16886)
	SpellInfo(natures_grace duration=15)
Define(natures_grasp 16689)
	SpellInfo(natures_grasp cd=60 duration=45)
	SpellInfo(natures_grasp addcd=-45 glyph=glyph_of_natures_grasp)
Define(natures_swiftness 132158)
	SpellInfo(natures_swiftness cd=60 duration=86400)
	SpellAddBuff(natures_swiftness natures_swiftness=1)
Define(natures_vigil 124974)
	SpellInfo(natures_vigil cd=90 duration=30)
	SpellAddBuff(natures_vigil natures_vigil=1)
Define(natures_vigil_talent 18)
Define(nourish 50464)
	SpellAddBuff(nourish natures_swiftness=0)
Define(omen_of_clarity 135700)
Define(owlkin_frenzy 48391)
	SpellInfo(owlkin_frenzy duration=10)
Define(pounce 9005)
	SpellInfo(pounce combo=1)
	SpellAddTargetDebuff(pounce pounce_bleed=1)
Define(pounce_incarnation 102546)
	SpellInfo(pounce_incarnation combo=1)
	SpellAddTargetDebuff(pounce_incarnation pounce_bleed=1)
Define(pounce_bleed 9007)
	SpellInfo(pounce_bleed duration=18 tick=3)
Define(predatory_swiftness 69369)
	SpellInfo(predatory_swiftness duration=8)
Define(primal_fury 16961)
Define(prowl 5215)
	SpellInfo(prowl duration=1800)
	SpellAddBuff(prowl cat_form=1 prowl=1)
Define(prowl_incarnation 102547)
	SpellInfo(prowl_incarnation duration=1800)
	SpellAddBuff(prowl_incarnation cat_form=1 prowl_incarnation=1)
Define(rake 1822)
	SpellInfo(rake combo=1 duration=15 tick=3)
	SpellInfo(rake critcombo=1 if_spell=primal_fury)
	# Damage(rake) = (99 + 0.3 * AP) damage per tick (from Catus).
	SpellInfo(rake base=99 bonusap=0.3)
	SpellDamageBuff(rake dream_of_cenarius_damage=1.3)
	SpellAddTargetDebuff(rake rake=1)
Define(ravage 6785)
	SpellInfo(ravage combo=1 inccounter=ripshreds)
	SpellInfo(ravage critcombo=1 if_spell=primal_fury)
	SpellAddTargetDebuff(ravage infected_wounds=1)
Define(ravagebang 102545)
	SpellInfo(ravagebang combo=1 inccounter=ripshreds)
	SpellInfo(ravagebang critcombo=1 if_spell=primal_fury)
	SpellAddBuff(ravagebang stampede=0)
	SpellAddTargetDebuff(ravagebang infected_wounds=1)
Define(rebirth 20484)
	SpellInfo(rebirth cd=600)
	SpellAddBuff(rebirth natures_swiftness=0 predatory_swiftness=0)
Define(regrowth 8936)
	SpellInfo(regrowth duration=6 haste=spell tick=2)
	SpellAddBuff(regrowth natures_swiftness=0)
Define(rejuvenation 774)
	SpellInfo(rejuvenation duration=12 haste=spell tick=3)
Define(remove_corruption 2782)
	SpellInfo(remove_corruption cd=8)
Define(renewal 108238)
	SpellInfo(renewal cd=120)
Define(renewal_talent 5)
Define(revive 50769)
Define(rip 1079)
	SpellInfo(rip combo=0 duration=16 resetcounter=ripshreds tick=2)
	SpellInfo(rip addduration=4 itemset=T14_melee itemcount=4)
	# Rip does (113 + 320 * CP + 0.0484 * AP * CP * 8) damage over 16 seconds (from Wowhead).
	# Damage(rip) = (14.125 + 40 * CP + 0.0484 * AP * CP) damage per tick.
	SpellInfo(rip base=14.125 bonuscp=40 bonusapcp=0.0484)
	SpellDamageBuff(rip dream_of_cenarius_damage=1.3)
	SpellAddTargetDebuff(rip rip=1)
Define(savage_defense 62606)
	SpellInfo(savage_defense rage=60)
	SpellInfo(savage_defense itemset=T13 itemcount=2 rage=55)
	SpellAddBuff(savage_defense savage_defense_buff=1)
Define(savage_defense_buff 132402)
	SpellInfo(savage_defense_buff duration=6)
Define(savage_roar 52610)
	SpellInfo(savage_roar combo=0 duration=18)
	SpellAddBuff(savage_roar savage_roar=1)
Define(savage_roar_glyphed 127538)
	SpellInfo(savage_roar_glyphed combo=-5 duration=18)
	SpellAddBuff(savage_roar_glyphed savage_roar_glyphed=1)
SpellList(savage_roar_buff savage_roar savage_roar_glyphed)
Define(shooting_stars 93400)
	SpellInfo(shooting_stars duration=12)
Define(shred 5221)
	SpellInfo(shred combo=1 inccounter=ripshreds)
	SpellInfo(shred critcombo=1 if_spell=primal_fury)
	SpellAddTargetDebuff(shred infected_wounds=1)
Define(shredbang 114236)
	SpellInfo(shredbang combo=1 inccounter=ripshreds)
	SpellInfo(shredbang critcombo=1 if_spell=primal_fury)
	SpellAddTargetDebuff(shredbang infected_wounds=1)
Define(skull_bash_bear 106839)
	SpellInfo(skull_bash_bear cd=15)
	SpellInfo(skull_bash_bear addcd=5 glyph=glyph_of_skull_bash)
Define(skull_bash_cat 80965)
	SpellInfo(skull_bash_cat cd=15)
	SpellInfo(skull_bash_cat addcd=5 glyph=glyph_of_skull_bash)
Define(solar_beam 78675)
	SpellInfo(solar_beam cd=60)
Define(solar_eclipse 48517)
Define(son_of_ursoc 102558)
	SpellInfo(son_of_ursoc cd=180 duration=30)
Define(soothe 2908)
Define(soul_of_the_forest 114108)
	SpellInfo(soul_of_the_forest duration=6)
Define(soul_of_the_forest_talent 10)
Define(stampede 81022)
	SpellInfo(stampede duration=86400)
Define(stampeding_roar 106898)
	SpellInfo(stampeding_roar cd=120 duration=8)
	SpellAddBuff(stampeding_roar stampeding_roar=1)
Define(starfall 48505)
	SpellInfo(starfall cd=90 duration=10)
Define(starfire 2912)
	SpellInfo(starfire eclipse=20)
Define(starsurge 78674)
	SpellInfo(starsurge cd=15 eclipse=20 eclipsedir=1)
	SpellAddBuff(starsurge shooting_stars=0)
Define(sunfire 93402)
	SpellInfo(sunfire duration=14 haste=spell tick=2)
	SpellInfo(sunfire addduration=2 itemset=T14_caster itemcount=4)
	SpellAddTargetDebuff(sunfire lunar_shower=1 sunfire=1)
Define(survival_instincts 61336)
	SpellInfo(survival_instincts cd=180 duration=12)
	SpellInfo(survival_instincts addcd=-60 duration=6 glyph=glyph_of_survival_instincts)
	SpellAddBuff(survival_instincts survival_instincts=1)
Define(swift_flight_form 40120)
	SpellInfo(swift_flight_form duration=86400)
	SpellAddBuff(swift_flight_form swift_flight_form=1)
Define(swipe 106785)
Define(swipe_bear 779)
	SpellInfo(swipe_bear cd=3 rage=15)
Define(swipe_cat 62078)
	SpellInfo(swipe_cat combo=1)
Define(symbiosis 110309)
	SpellInfo(symbiosis duration=3600)
	SpellAddBuff(symbiosis symbiosis=1)
Define(symbiosis_anti_magic_shell 110570)
	SpellInfo(symbiosis_anti_magic_shell cd=45 duration=5)
	SpellAddBuff(symbiosis_anti_magic_shell symbiosis_anti_magic_shell=1)
Define(symbiosis_bone_shield 122285)
	SpellInfo(symbiosis_bone_shield cd=60 duration=300)
	SpellAddBuff(symbiosis_bone_shield symbiosis_bone_shield=1)
Define(symbiosis_clash 126449)
	SpellInfo(symbiosis_clash cd=35)
Define(symbiosis_cleanse 122288)
	SpellInfo(symbiosis_cleanse cd=8)
Define(symbiosis_cloak_of_shadows 110788)
	SpellInfo(symbiosis_cloak_of_shadows cd=120 duration=5)
	SpellAddBuff(symbiosis_cloak_of_shadows symbiosis_cloak_of_shadows=1)
Define(symbiosis_consecration 110701)
	SpellInfo(symbiosis_consecration cd=30 duration=10)
Define(symbiosis_death_coil 122282)
	SpellInfo(symbiosis_death_coil)
Define(symbiosis_demonic_circle_teleport 112970)
	SpellInfo(symbiosis_demonic_circle_teleport cd=30)
Define(symbiosis_deterrence 110617)
	SpellInfo(symbiosis_deterrence cd=120 duration=5)
	SpellAddBuff(symbiosis_deterrence symbiosis_deterrence=1)
Define(symbiosis_dispersion 110715)
	SpellInfo(symbiosis_dispersion cd=180 duration=6)
	SpellAddBuff(symbiosis_dispersion symbiosis_dispersion=1)
Define(symbiosis_divine_shield 110700)
	SpellInfo(symbiosis_divine_shield cd=300 duration=8)
	SpellAddBuff(symbiosis_divine_shield symbiosis_divine_shield=1)
Define(symbiosis_elusive_brew 126453)
	SpellInfo(symbiosis_elusive_brew cd=60 duration=8)
	SpellAddBuff(symbiosis_elusive_brew symbiosis_elusive_brew=1)
Define(symbiosis_evasion 110791)
	SpellInfo(symbiosis_evasion cd=180 duration=15)
	SpellAddBuff(symbiosis_evasion symbiosis_evasion=1)
Define(symbiosis_fear_ward 110717)
	SpellInfo(symbiosis_fear_ward cd=180 duration=180)
Define(symbiosis_feint 122289)
	SpellInfo(symbiosis_feint duration=5 rage=20)
	SpellAddBuff(symbiosis_feint symbiosis_feint=1)
Define(symbiosis_feral_spirit 110807)
	SpellInfo(symbiosis_feral_spirit cd=120)
Define(symbiosis_fortifying_brew 126456)
	SpellInfo(symbiosis_fortifying_brew cd=180 duration=20)
	SpellAddBuff(symbiosis_fortifying_brew symbiosis_fortifying_brew=1)
Define(symbiosis_frost_armor 110694)
	SpellInfo(symbiosis_frost_armor duration=86400)
	SpellAddBuff(symbiosis_frost_armor symbiosis_frost_armor=1)
Define(symbiosis_frost_nova 110693)
	SpellInfo(symbiosis_frost_nova cd=25 duration=8)
Define(symbiosis_grapple_weapon 126458)
	SpellInfo(symbiosis_grapple_weapon cd=60 duration=8)
	SpellAddTargetDebuff(symbiosis_grapple_weapon symbiosis_grapple_weapon=1)
Define(symbiosis_hammer_of_justice 110698)
	SpellInfo(symbiosis_hammer_of_justice cd=60 duration=6)
	SpellAddTargetDebuff(symbiosis_hammer_of_justice symbiosis_hammer_of_justice=1)
Define(symbiosis_ice_block 110696)
	SpellInfo(symbiosis_ice_block cd=300 duration=10)
	SpellAddBuff(symbiosis_ice_block symbiosis_ice_block=1)
Define(symbiosis_ice_trap 110600)
	SpellInfo(symbiosis_ice_trap cd=30)
Define(symbiosis_icebound_fortitude 110575)
	SpellInfo(symbiosis_icebound_fortitude cd=180 duration=12)
	SpellAddBuff(symbiosis_icebound_fortitude symbiosis_icebound_fortitude=1)
Define(symbiosis_intervene 122292)
	SpellInfo(symbiosis_intervene cd=30 duration=10)
	SpellAddBuff(symbiosis_intervene symbiosis_intervene=1)
Define(symbiosis_intimidating_roar 113004)
	SpellInfo(symbiosis_intimidating_roar cd=90 duration=8)
	SpellAddTargetDebuff(symbiosis_intimidating_roar symbiosis_intimidating_roar=1)
Define(symbiosis_leap_of_faith 110718)
	SpellInfo(symbiosis_leap_of_faith cd=90)
Define(symbiosis_life_tap 122290)
	SpellInfo(symbiosis_life_tap cd=15 rage=-30)
Define(symbiosis_lightning_shield 110803)
	SpellInfo(symbiosis_lightning_shield duration=600)
Define(symbiosis_mass_dispel 110707)
	SpellInfo(symbiosis_mass_dispel cd=60)
Define(symbiosis_mirror_image 110621)
	SpellInfo(symbiosis_mirror_image cd=180 duration=30)
	SpellAddBuff(symbiosis_mirror_image symbiosis_mirror_image=1)
Define(symbiosis_misdirection 110588)
	SpellInfo(symbiosis_misdirection cd=30 duration=20)
	SpellAddBuff(symbiosis_misdirection symbiosis_misdirection=1)
Define(symbiosis_play_dead 110597)
	SpellInfo(symbiosis_play_dead cd=30 duration=360)
	SpellAddBuff(symbiosis_play_dead symbiosis_play_dead=1)
Define(symbiosis_purge 110802)
Define(symbiosis_redirect 110730)
	SpellInfo(symbiosis_redirect cd=60)
Define(symbiosis_shattering_blow 112997)
	SpellInfo(symbiosis_shattering_blow cd=300 duration=10)
	SpellAddBuff(symbiosis_shattering_blow cat_form=1)
	SpellAddTargetDebuff(symbiosis_shattering_blow symbiosis_shattering_blow=1)
Define(symbiosis_soul_swap 110810)
	SpellInfo(symbiosis_soul_swap cd=30)
	SpellAddBuff(symbiosis_soul_swap cat_form=1)
Define(symbiosis_spell_reflection 113002)
	SpellInfo(symbiosis_spell_reflection cd=120 duration=5)
	SpellAddBuff(symbiosis_spell_reflection symbiosis_spell_reflection=1)
Define(symbiosis_spiritwalkers_grace 110806)
	SpellInfo(symbiosis_spiritwalkers_grace cd=120 duration=15)
	SpellAddBuff(symbiosis_spiritwalkers_grace symbiosis_spiritwalkers_grace=1)
Define(symbiosis_unending_resolve 122291)
	SpellInfo(symbiosis_unending_resolve cd=180 duration=12)
	SpellAddBuff(symbiosis_unending_resolve symbiosis_unending_resolve=1)
Define(thrash 106832)
Define(thrash_bear 77758)
	SpellInfo(thrash_bear cd=6 duration=16 tick=2)
	SpellAddTargetDebuff(thrash_bear thrash_bear=1 weakened_blows=1)
Define(thrash_cat 106830)
	SpellInfo(thrash_cat duration=15 tick=3)
	SpellAddTargetDebuff(thrash_cat thrash_cat=1 weakened_blows=1)
Define(tigers_fury 5217)
	SpellInfo(tigers_fury cd=30 duration=6 energy=-60)
	SpellAddBuff(tigers_fury tigers_fury=1)
Define(tooth_and_claw 135286)
	SpellInfo(tooth_and_claw duration=10)
Define(tooth_and_claw_debuff 135601)
	SpellInfo(tooth_and_claw_debuff duration=15)
Define(tranquility 740)
	SpellInfo(tranquility canStopChannelling=4 cd=480 duration=8 haste=spell tick=2)
Define(treants 106737)
	SpellInfo(treants cd=60)
Define(treants_balance 33831)
	SpellInfo(treants_balance cd=60)
Define(treants_feral 102703)
	SpellInfo(treants_feral cd=60)
Define(treants_guardian 102706)
	SpellInfo(treants_guardian cd=60)
Define(treants_restoration 102693)
	SpellInfo(treants_restoration cd=60)
Define(tree_of_life 33891)
	SpellInfo(tree_of_life cd=180 duration=30)
Define(typhoon 132469)
	SpellInfo(typhoon cd=30)
Define(typhoon_talent 9)
Define(ursols_vortex 102793)
	SpellInfo(ursols_vortex cd=60)
Define(ursols_vortex_talent 11)
Define(weakened_armor 113746)	# stacks 3 times
    SpellInfo(weakened_armor duration=30)
Define(weakened_blows 115798)
    SpellInfo(weakened_blows duration=30)
Define(wild_charge 102401)
	SpellInfo(wild_charge cd=15)
Define(wild_charge_bear 16979)
	SpellInfo(wild_charge_bear cd=15)
Define(wild_charge_cat 49376)
	SpellInfo(wild_charge_cat cd=15)
Define(wild_charge_moonkin 102383)
	SpellInfo(wild_charge_moonkin cd=15)
Define(wild_charge_talent 3)
Define(wild_growth 48438)
	SpellInfo(wild_growth cd=8 duration=7 haste=spell tick=1)
	SpellInfo(wild_growth addcd=2 glyph=glyph_of_wild_growth)
Define(wild_mushroom_balance 88747)
Define(wild_mushroom_restoration 145205)
	SpellInfo(wild_mushroom_restoration cd=3 sharedcd=mushroom)
Define(wild_mushroom_bloom 102791)
	SpellInfo(wild_mushroom_bloom cd=3 sharedcd=mushroom)
Define(wild_mushroom_detonate 88751)
	SpellInfo(wild_mushroom_detonate cd=10)
Define(wrath 5176)
	SpellInfo(wrath eclipse=-15)
Define(yseras_gift_talent 4)

# Items
Define(jade_serpent_potion 76093)
Define(jade_serpent_potion_buff 105702)
	SpellInfo(jade_serpent_potion_buff duration=25)
Define(virmens_bite_potion 76089)
Define(virmens_bite_potion_buff 105697)
	SpellInfo(virmens_bite_potion_buff duration=25)

# Rune of Re-Origination
ItemList(rune_of_reorigination 94532 95802 96546)
Define(rune_of_reorigination_crit_buff 139117)
	SpellInfo(rune_of_reorigination_crit_buff duration=10)
Define(rune_of_reorigination_haste_buff 139121)
	SpellInfo(rune_of_reorigination_haste_buff duration=10)
Define(rune_of_reorigination_mastery_buff 139120)
	SpellInfo(rune_of_reorigination_mastery_buff duration=10)
SpellList(rune_of_reorigination_buff rune_of_reorigination_crit_buff rune_of_reorigination_haste_buff rune_of_reorigination_mastery_buff)

# Racials
Define(berserking 26297)
	SpellInfo(berserking cd=180 duration=10)
	SpellAddBuff(berserking berserking=1)



AddFunction UseItemActions
{
	Item(HandsSlot usable=1)
}

###
### Druid (all specializations)
###

# Show the full rotation in an extra icon.
AddCheckBox(full_rotation "Full rotation")

# Faerie Fire/Swarm
AddCheckBox(opt_faerie_fire SpellName(faerie_fire) default)
AddFunction FaerieFire
{
	if CheckBoxOn(opt_faerie_fire)
	{
		if TalentPoints(faerie_swarm_talent) Spell(faerie_swarm)
		if not TalentPoints(faerie_swarm_talent) Spell(faerie_fire)
	}
}

AddFunction FaerieFireReady
{
	CheckBoxOn(opt_faerie_fire)
		and {{TalentPoints(faerie_swarm_talent) and Spell(faerie_swarm)}
			or {not TalentPoints(faerie_swarm_talent) and Spell(faerie_fire)}}
}



###
### Balance
###


AddFunction BalanceInterrupt
{
	if not target.IsFriend() and target.IsInterruptible()
	{
		if not target.Classification(worldboss)
		{
			if TalentPoints(mighty_bash_talent) and target.InRange(mighty_bash) Spell(mighty_bash)
			if TalentPoints(typhoon_talent) Spell(typhoon)
			Spell(solar_beam)
		}
	}
}

AddFunction BalanceBuffActions
{
	if BuffExpires(str_agi_int any=1) Spell(mark_of_the_wild)
	if BuffExpires(moonkin_form) Spell(moonkin_form)
}

AddFunction BalanceNaturesGraceRemains
{
	if ArmorSetParts(T14_caster) <4
	{
		BuffRemains(natures_grace) -2
	}
	if ArmorSetParts(T14_caster) >=4
	{
		BuffRemains(natures_grace)
	}
}

AddFunction BalanceFullRotation
{
	BalanceBuffActions()
        if Speed() > 0 BalanceMovingActions()
	if BuffExpires(starfall) Spell(starfall)
	if BuffPresent(celestial_alignment) or SpellCooldown(celestial_alignment) >30 UseItemActions()
	if TalentPoints(natures_swiftness_talent) and TalentPoints(dream_of_cenarius_talent) Spell(natures_swiftness)
	if TalentPoints(dream_of_cenarius_talent) and BuffExpires(dream_of_cenarius_damage) and ManaPercent() >25 Spell(healing_touch)
	if TalentPoints(incarnation_talent) and {BuffPresent(lunar_eclipse) or BuffPresent(solar_eclipse)} Spell(chosen_of_elune)
	if BuffExpires(lunar_eclipse) and BuffExpires(solar_eclipse) and
		{BuffPresent(chosen_of_elune) or not TalentPoints(incarnation_talent) or SpellCooldown(chosen_of_elune) >10}
	{
		Spell(celestial_alignment)
	}
	if TalentPoints(natures_vigil_talent) Spell(natures_vigil)
	if BuffPresent(shooting_stars) and {Enemies() <5 or BuffExpires(solar_eclipse)} Spell(starsurge)
	if BuffPresent(lunar_eclipse) and target.DebuffRemains(moonfire) <BalanceNaturesGraceRemains() Spell(moonfire)
	if BuffPresent(solar_eclipse) and target.DebuffRemains(sunfire) <BalanceNaturesGraceRemains() Spell(sunfire)
	if Enemies() <5 and target.DebuffRemains(moonfire) <BalanceNaturesGraceRemains() Spell(moonfire)
	if Enemies() <5 and target.DebuffRemains(sunfire) <BalanceNaturesGraceRemains() Spell(sunfire)
	if Enemies() >5 and BuffPresent(solar_eclipse) and ManaPercent() >25 Spell(hurricane)
	if BuffPresent(lunar_eclipse) and target.TicksRemain(moonfire) <2 Spell(moonfire)
	if BuffPresent(solar_eclipse) and target.TicksRemain(sunfire) <2 Spell(sunfire)
	if Enemies() >4 and BuffPresent(solar_eclipse) and ManaPercent() >25 Spell(hurricane)
	Spell(starsurge)
	if BuffPresent(celestial_alignment) and CastTime(starfire) <BuffRemains(celestial_alignment) Spell(starfire)
	if BuffPresent(celestial_alignment) and CastTime(wrath) <BuffRemains(celestial_alignment) Spell(wrath)
	if EclipseDir() >0 or {EclipseDir() ==0 and Eclipse() >0} Spell(starfire)
	if EclipseDir() <0 or {EclipseDir() ==0 and Eclipse() <=0} Spell(wrath)
	if target.TicksRemain(moonfire) <2 Spell(moonfire)
	if target.TicksRemain(sunfire) <2 Spell(sunfire)
}

AddFunction BalanceHurricaneActions
{
	if Enemies() >4 and BuffPresent(solar_eclipse)
	{
		if BuffPresent(natures_grace) or ManaPercent() >25 Spell(hurricane)
	}
}


AddFunction BalanceMovingActions
{
	if BuffPresent(natures_swiftness)
	{
		if TalentPoints(dream_of_cenarius_talent) and BuffExpires(dream_of_cenarius_damage) and ManaPercent() >25 Spell(healing_touch)
	}
	if BuffPresent(shooting_stars) and BuffExpires(solar_eclipse) Spell(starsurge)if BuffPresent(lunar_eclipse) and target.DebuffRemains(moonfire) <BalanceNaturesGraceRemains() Spell(moonfire)
	if BuffPresent(solar_eclipse) and target.DebuffRemains(sunfire) <BalanceNaturesGraceRemains() Spell(sunfire)
	if target.DebuffRemains(moonfire) <BalanceNaturesGraceRemains() Spell(moonfire)
	if target.DebuffRemains(sunfire) <BalanceNaturesGraceRemains() Spell(sunfire)
	if BuffPresent(lunar_eclipse) and target.TicksRemain(moonfire) <2 Spell(moonfire)
	if BuffPresent(solar_eclipse) and target.TicksRemain(sunfire) <2 Spell(sunfire)
	if target.TicksRemain(moonfire) <2 Spell(moonfire)
	if target.TicksRemain(sunfire) <2 Spell(sunfire)
	if BuffPresent(shooting_stars) Spell(starsurge)
	if BuffPresent(lunar_eclipse) Spell(moonfire)
	Spell(sunfire)
}

### Balance Icons

# Healing cooldowns.
AddIcon mastery=1 help=FullRotation
{
	BalanceFullRotation()
}




]]
}